import axios from 'axios'
export async function getThroneList(page,limit){
    var resp = await axios.get("/api/petsSystem/throne.do",{
        params:{
            page,
            limit
        }
    });
    return resp.data.data;
}

export async function queryThrone(page,limit,content){
    var resp = await axios.get("/api/petsSystem/throne.do",{
        params:{
            method:'query',
            page,
            limit,
            content
        }
    });
    return resp.data;
}

export async function addThrone(throne){
    var resp = await axios.get("/api/petsSystem/throne.do",{
        params:{
            method:'addThrone',
            throneName:throne.throneName,
            throneDesc:throne.throneDesc,
            thronePath:throne.thronePath
        }
    });
    return resp.data;
}

export async function deleteThrone(id){
    var resp = await axios.get("/api/petsSystem/throne.do",{
        params:{
            method:"deleteThrone",
            throneId:id
        }
    });
    return resp.data;
}
export async function updateThrone(throne){
    var resp = await axios.get("/api/petsSystem/throne.do",{
        params:{
            method:'updateThrone',
            throneId:throne.throneId,
            throneName:throne.throneName,
            throneDesc:throne.throneDesc,
            thronePath:throne.thronePath
        }
    });
    return resp.data;
}

export async function throneDistribution(){
    var resp = await axios.get("/api/petsSystem/throne.do",{
        params:{
            method:'throneDistribution',
        }
    });
    return resp.data;
}
export async function getRoleThrone(roleId){
    var resp = await axios.get("/api/petsSystem/throne.do",{
        params:{
            method:"getRoleThrone",
            roleId
        }
    });
    return resp.data;
}

export async function changeThrone(value,roleId){
    var resp = await axios.get("/api/petsSystem/throne.do",{
        params:{
            method:"changeThrone",
            value,
            roleId
        }
    });
    return resp.data;
}


